<?
    include "./common.php" ;
    $opt = $_POST['opt'] ;
    // move_uploaded_file
    $arr = [] ;
    if( $opt == 'getData' ){
        $page = $_POST['page'] ; 
        $perPage = $_POST['perPage'];
        $pageSt = ( $page - 1 ) * $perPage ; 
        $sql = "SELECT * FROM `users` ORDER BY id ASC LIMIT $pageSt , $perPage " ;
        $res = mysqli_query($link,$sql);
        while( $one = mysqli_fetch_assoc($res) ){
            $arr[] = $one ; 
        }
    }
    echo json_encode($arr);
?>